package com.uplift.mobile.rate.controller;

import com.uplift.common.result.IResultable;
import com.uplift.common.result.ResultWrapper;
import com.uplift.common.result.ResultWrapper4Layui;
import com.uplift.mobile.info.model.Info;
import com.uplift.mobile.info.service.IInfoService;
import com.uplift.mobile.rate.model.Rate;
import com.uplift.mobile.rate.service.IRateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 汇率相关
 * 
 * @author bcwang
 *
 */
@Controller
@RequestMapping(value = "/rate")
public class RateController {

	@Autowired
	private IRateService rateService;


	/**
	 * 查询资讯详细
	 *
	 * @param
	 * @return IResultable
	 */
	@RequestMapping(value = "/update")
	@ResponseBody
	public IResultable update(HttpServletRequest request, Rate rate) {
		try {
			this.rateService.updateRate();
			return ResultWrapper4Layui.wrapMap(null, ResultWrapper4Layui.SUCC, "更新成功");
		} catch (Exception e) {
			return ResultWrapper4Layui.wrapMap(null, ResultWrapper4Layui.FAIL, "更新失败");
		}

	}
}
